package gov.tax.rti.ext.spring;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.AnnotationBeanNameGenerator;
/**
 * RTI系统注解bean名生成类
 * 
 * @since 2013年11月6日
 * @author steven.zheng
 * @version 1.00 2013年11月6日
 */
public abstract class RtiAnnotationBeanNameGenerator extends AnnotationBeanNameGenerator {
	
	public static String RTI_BEAN_NAMEPREFIX = "rti";
	
	protected String getNamePrefix() {
		return RTI_BEAN_NAMEPREFIX;
	}
	
	protected String buildDefaultBeanName(BeanDefinition definition) {
		String beanName = super.buildDefaultBeanName(definition);
		String namePrefix = getNamePrefix();
		if(StringUtils.isNotEmpty(namePrefix)){
			return getNamePrefix() + "." + beanName;
		}
		return beanName;
	}

}
